package cliente;

import org.hibernate.SQLQuery;

import persistencia.GenericDAOAbstract;

public class ClienteDAOHibernate extends GenericDAOAbstract<Cliente, Long>
		implements ClienteDAO {

	public Cliente buscaPorCpfCnpj(String cpfCnpj){
		
		String sql ="SELECT * FROM cliente  c where c.cnpjCpf = '" + cpfCnpj + "'"; 
		SQLQuery sqlQuery = getSession().createSQLQuery(sql).addEntity(Cliente.class);
		return (Cliente) sqlQuery.uniqueResult(); 
	}
}
